package com.caiheng.api.entity.mer;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.caiheng.api.entity.product.Product;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 服务商家对象 mer
 *
 * @author ruoyi
 * @date 2021-09-05
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("mer")
public class Mer implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

//    private Integer userId;
    /**
     *  所属小区id
     */
    private Integer estateId;

    private String shopNo;

    /**
     * 商家名称
     */
    private String shopName;

    /**
     *  0 - 普通商家
     */
    private Integer shopType;

    private Integer serviceStar;

    private Integer maxOrderCount;

    private Integer isSelf;

    /**
     * 商家地址
     */
    private String address;

    private Integer isPlatform;

    private Integer cateId;

    private Integer cateChildId;

    /**
     * 经度
     */
    private BigDecimal longitude;

    /**
     * 纬度
     */
    private BigDecimal latitude;

    private Integer provId;

    private Integer cityId;
    /**
     *  所在省份
     */
    private String provName;
    /**
     *  所在城市
     */
    private String cityName;
    /**
     *  所在区县
     */
    private Integer districtId;

    /**
     * 服务电话
     */
    private String telphone;

    /**
     * 邮箱地址
     */
    private String email;

    /**
     * 负责人姓名
     */
    private String leaderName;

    private String shopLogo;

    private String keyWord;

    /**
     * 商家状态
     */
    private Integer state;

    private String codeImg;
    private String idCardImgBefore;
    private String idCardImgAfter;

    private Integer checkState;
    private String checkResult;
    private String creditCode;

    private Integer subType;
    private BigDecimal subRate;
    /**
     *  养殖场适用  首付结算比例
     */
    private BigDecimal subFirstPayRate;
    //折扣券的分成比例
    private BigDecimal subCouponRate;
    private String heTongPic;
    private String signImg;

    //商家二维码
    private String qrCode;

    /**
     * 邀请人id
     */
    private Integer agId;

    /**
     * 结算银行名称
     */
    private String bankName;
    /**
     * 结算银行卡号
     */
    private String bankCardNo;
    /**
     * 结算银行卡账户名（姓名）
     */
    private String bankRealName;

    /**
     *  支付费用方式  0 - 未开通 1 - 已开通
     */
    private Integer moneyPay;


    /**
     *   吃饭结账时间，0 - 先支付，1 - 后支付
     */
    private Integer isPayFirst;

    /**
     *  支付平台  0 - 微信  1 - 农商行
     */
    private Integer payPlatform;

    /**
     *  第三方支付商户id（农商行商户id）
     */
    private Integer payPlatformId;

    /**
     *  是否有折扣
     */
    private Integer isDiscount;

    /**
     *  折扣
     */
    private Double discountRate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activeBeginTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date activeEndTime;


    /**
     * 添加时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;


    @TableField(exist = false)
    List<Product> products;

    @TableField(exist = false)
    private Integer productCount;

    @TableField(exist = false)
    List<MerCoupon> coupons;

    @TableField(exist = false)
    private String distance;

    @TableField(exist = false)
    private String[] keywords;
}
